<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <link rel="stylesheet" href="./css/bootstrap.css">
  <link rel="stylesheet" href="./css/bootstrap-theme.css">
  <script src="./js/jquery.js"></script>
  <script src="./js/bootstrap.js"></script>
  <style>
    body {
      height: 100vh;
    }
  </style>
</head>

<body>
  <nav class="navbar navbar-default">
    <div class="container-fluid">
      <!-- Brand and toggle get grouped for better mobile display -->
      <div class="navbar-header">
        <p class="navbar-brand">管理员界面</p>
      </div>
      <!-- Collect the nav links, forms, and other content for toggling -->
      <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
        <ul class="nav navbar-nav">
          <li class="dropdown">
            <a class="dropdown-toggle" role="button" href="./usercontrol.html">用户管理</a>
          </li>
          <li class="dropdown">
            <a class="dropdown-toggle" role="button" href="./librariy.html">图书管理</a>
          </li>
          <li class="dropdown">
            <a class="dropdown-toggle" role="button" href="./salecontrol.html">订单管理</a>
          </li>
        </ul>
        <ul class="nav navbar-nav navbar-right">
          <li>
            <p class="navbar-text">欢迎你，管理员</p>
          </li>
          <li class="dropdown">
            <a id="logout">注销</a>
          </li>
        </ul>
      </div><!-- /.navbar-collapse -->
    </div><!-- /.container-fluid -->
  </nav>
  <div style="width: 100%;height: 90%;">
    <iframe id="navFrame" width="100%" height="140%" scrolling="no" frameborder="0" src="./usercontrol.html"></iframe>
  </div>
  <script>
    //页面跳转方法
    function tablechange(e){
      if (e.target.href) {
          e.preventDefault();
          console.log(e.target.href)
          $("#navFrame").attr("src", e.target.href);
        }
    }
    $("#logout").click(()=>{
      location.href="./login.html"
    })
    $(() => {
      //页面跳转
      $("a").click((e) => {
        tablechange(e);
      })
    })
  </script>
</body>

</html>